# Use the C or C++ compiler
#Compiler                = wcc386
Compiler                = wpp386

# compiler options for code that has to run from an interrupt:
#Compiler_Options1       = /d2 /od /5r /j /s /zu
Compiler_Options1       = /oailrte /5r /j /s /zu

# options for other code:
#Compiler_Options2       = /d2 /od /5r /j /s
Compiler_Options2       = /oailrte /5r /j /s

# Compile using dos4g or pmodew
System                  = dos4g
#System                 = pmodew

Lib_file                = mikmod.lib

GeneralObjs             = mmio.obj &
                          mirq.obj &
                          mdma.obj &
                          virtch.obj &
                          resample.obj &
                          munitrk.obj &
                          mplayer.obj &
                          mwav.obj

LoaderObjs              = mloader.obj &
			  load_mod.obj &
			  load_m15.obj &
			  load_mtm.obj &
			  load_s3m.obj &
			  load_stm.obj &
			  load_xm.obj &
			  load_uni.obj &
                          load_ult.obj

DriverObjs              = mdriver.obj &
			  drv_nos.obj &
			  drv_gus.obj &
                          drv_sb.obj &
                          drv_ss.obj

####################
## Makefile rules ##
####################


$(Lib_file): $(GeneralObjs) $(LoaderObjs) $(DriverObjs)
             *wlib $(Lib_file) $(GeneralObjs) $(LoaderObjs) $(DriverObjs)

# next are the exceptions that don't have to be compiled with the /zu option
# since they will never be called from a interrupt. hey.. I _tried_ to find
# a clean solution..

wildfile.obj :  wildfile.c
                $(Compiler) $(Compiler_Options2) $<

getopt.obj :    getopt.c
                $(Compiler) $(Compiler_Options2) $<

mmio.obj :      mmio.c
                $(Compiler) $(Compiler_Options2) $<

mloader.obj :   mloader.c
                $(Compiler) $(Compiler_Options2) $<

mikcvt.obj :    mikcvt.c
                $(Compiler) $(Compiler_Options2) $<

load_m15.obj :  load_m15.c
                $(Compiler) $(Compiler_Options2) $<

load_mod.obj :  load_mod.c
                $(Compiler) $(Compiler_Options2) $<

load_mtm.obj :  load_mtm.c
                $(Compiler) $(Compiler_Options2) $<

load_ult.obj :  load_ult.c
                $(Compiler) $(Compiler_Options2) $<

load_stm.obj :  load_stm.c
                $(Compiler) $(Compiler_Options2) $<

load_s3m.obj :  load_s3m.c
                $(Compiler) $(Compiler_Options2) $<

load_xm.obj :   load_xm.c
                $(Compiler) $(Compiler_Options2) $<

load_uni.obj :  load_uni.c
                $(Compiler) $(Compiler_Options2) $<

.c.obj:
        $(Compiler) $(Compiler_Options1) $<

.asm.obj:
        wasm -3pr $<
